<div class="tp_page_title">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_page_heading">
					<h3><?php echo $blog_detail[0]['blog_title']; ?></h3>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="tp_gray_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
				<div class="tp_blog_div">
				   <?php if(!empty($blog_detail[0]['blog_image'])){
						$blog_img_src=base_url().'repo/images/'.$blog_detail[0]['blog_image'];
						?>
					<div class="tp_blog_img">
						<img src="<?php echo $blog_img_src; ?>" class="img-responsive" alt="blog image">
					</div>
				   <?php } ?>
					<div class="tp_blog_content">
						<h3><?php echo $blog_detail[0]['blog_title']; ?></h3>
						<ul class="tp_blog_tag">
							<li><a href="javascript:"><i class="fa fa-user"></i>Admin</a></li>
								<li><a href="javascript:"><i class="fa fa-clock-o"></i> <?php echo date("M d,Y", strtotime($blog_detail[0]['blog_date'])); ?></a></li>
								<li><a href="javascript:"><i class="fa fa-comment-o"></i> <?php echo $comment_count; ?></a></li>
							
						</ul>
						<p><?php echo $blog_detail[0]['blog_content']; ?></p>
					
					</div>
				</div>
				<?php if(!empty($comments)){ ?>
				<div class="tp_comment">
					<h3><?php echo $this->ts_functions->getlanguage('allcomment','commontext','solo');?></h3>
					<ol class="comment">
					<?php foreach($comments as $parent_comment){ ?>
					
					<?php 
						   $parent_image_src= base_url().'webimage/dummy_testi.jpg';
							
						  ?>
						<li class="comment-list ts_blog_comment">
							<div class="tp_author_img">
								<img src="<?php echo $parent_image_src ; ?>" class="img-responsive" alt="">
							</div>
							<div class="tp_comment_data">
								<h2><?php echo $parent_comment['comment_uname'];  ?></h2>
								<h5><?php echo date("M d,Y", strtotime($parent_comment['comment_date'])); ?></h5>
								<p><?php if($parent_comment['comment_status']==1){?>
															<p><?php echo $parent_comment['comment_text'];  ?></p>
															<?php } else{ ?>
															<p><?php echo $this->ts_functions->getlanguage('awaitingmoderation','commontext','solo');?></p>
															<?php } ?></p>
								<a onclick="repy_form(<?php echo $parent_comment['comment_id'] ?>,this,'blog')" class="tp_reply comment_reply" ><i class="fa fa-reply"></i> <?php echo $this->ts_functions->getlanguage('replay','commontext','solo');?></a>
							</div>
							<?php $child_comments=$this->DatabaseModel->access_database('ts_comments','select', '' , array('comment_parent'=>$parent_comment['comment_id'],'comment_type'=>'blog'));
							if(!empty($child_comments)){
							?>
							<ul class="children">
							  <?php foreach($child_comments as $child_comments){ ?>
								<li class="comment-list ">
									<div class="tp_author_img">
										<img src="<?php echo  base_url().'webimage/dummy_testi.jpg'; ?>" class="img-responsive" alt="">
									</div>
									<div class="tp_comment_data">
										<h2><?php echo $child_comments['comment_uname']; ?></h2>
										<h5><?php echo date("M d,Y", strtotime($child_comments['comment_date'])); ?></h5>
										<p><?php if($child_comments['comment_status']==1){?>
										<p><?php echo $child_comments['comment_text'];  ?></p>
										<?php } else{ ?>
										<p><?php echo $this->ts_functions->getlanguage('awaitingmoderation','commontext','solo');?></p>
										<?php } ?></p>
									</div>
								</li>
							  <?php } ?>
							</ul>
							<?php } ?>
                           <div class="ts_cmntrplybox hide" id="ts_cmntrplybox">	
							</div>
						</li>
				     <?php } ?>	
					</ol>
				</div>
				<?php } ?>
				
				<div class="tp_comment_form">
				<?php
					if($this->session->userdata('ts_login')){
						$cmt_name =$this->session->userdata('ts_uname');
						$cmt_uid= $this->session->userdata('ts_uid');
						$cmtuserdata=$this->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$cmt_uid));
						$cmt_email=$cmtuserdata[0]['user_email'];
					}
					?>		
					<h3><?php echo $this->ts_functions->getlanguage('postnew','commontext','solo');?></h3>
					<form>
						<div class="row">
							<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 <?php if(isset($cmt_name)) echo 'hide'; ?>">
								<div class="form-group">
									<input type="text" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('yourname','commontext','solo');?>" name="cmt_name_0" id="cmt_name_0" value="<?php if(isset($cmt_name)) echo $cmt_name; ?>" />
								</div>	
							</div>
							<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 <?php if(isset($cmt_email)) echo 'hide'; ?>">
								<div class="form-group">
									<input type="email" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('yoursemail','commontext','solo');?>" id="cmt_email_0" name="cmt_email_0" value="<?php if(isset($cmt_email)) echo $cmt_email; ?>"/>
								</div>	
							</div>
							<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
								<div class="form-group">
									<textarea class="form-control" rows="5" placeholder="<?php echo $this->ts_functions->getlanguage('yourmsg','commontext','solo');?>" name="cmt_comment_0" id="cmt_comment_0"></textarea>
								</div>	
							</div>
							<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
								<button  type="button" onclick="send_comment_post(<?php echo $blog_detail[0]['blog_id'];?>,0,'','blog')" class="tp_btn"><?php echo $this->ts_functions->getlanguage('commentstext','singleproductpage','solo');?></button>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
				<div class="tp_sidebar">
					<div class="tp_sidebar_div tp_sidebar_search">
						
						<div class="form-inline">
							<div class="form-group">
								<input type="text" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('searchplaceholder','homepage','solo');?>" id="searchInput">
							</div>
							<button class="tp_btn" id="searchInputBtn"><i class="fa fa-search"></i></button>
						</div>
					</div>
					<div class="tp_sidebar_div tp_categories">
						<h3 ><?php echo $this->ts_functions->getlanguage('categories','commontext','solo');?></h3>
						<?php if(!empty($blog_categories)){ ?>
						<ul>
						<?php foreach($blog_categories as $single_category){ ?>
							<li><a href="<?php echo $basepath.'blogs/?category='.strtolower($single_category['blog_category_slug']);?>"><?php echo strtoupper($single_category['blog_category_name']);  ?></a></li>
							
						<?php  } ?>	
						</ul>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!--Blog content end-->
<input type="hidden" value="<?php echo $this->ts_functions->getlanguage('emptyerror','commontext','solo');?>" id="emptyerror">
<input type="hidden" value="<?php echo $this->ts_functions->getlanguage('email','message','solo');?>" id="emailerr_text">
<div class="hide" id="reply_form_div">
<input type="hidden" id="product_id" value="<?php echo $blog_detail[0]['blog_id'];?>">
        <div class="ts_blog_messages ts_toppadder30">
			<div class="row">
				<form>
					<div class="col-lg-6 <?php if(isset($cmt_name)) echo 'hide'; ?>">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('yourname','commontext','solo');?>" name="cmt_name" id="cmt_name" value="<?php if(isset($cmt_name)) echo $cmt_name; ?>" />
						</div>
					</div>
					<div class="col-lg-6 <?php if(isset($cmt_email)) echo 'hide'; ?>">
						<div class="form-group">
							<input type="email" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('yoursemail','commontext','solo');?>" id="cmt_email" name="cmt_email" value="<?php if(isset($cmt_email)) echo $cmt_email; ?>"/>
						</div>
					</div>
					<div class="col-lg-12">
						<div class="form-group">
							<textarea class="form-control" rows="5" placeholder="<?php echo $this->ts_functions->getlanguage('yourmsg','commontext','solo');?>" name="cmt_comment" id="cmt_comment"></textarea>
						</div>
					</div>
					<div class="col-lg-12 text-right">
						<a id="reply_to_main_a" onclick="send_comment_post(<?php echo $blog_detail[0]['blog_id'];?>,0,'','blog')" class="tp_btn"><?php echo $this->ts_functions->getlanguage('commentstext','singleproductpage','solo');?></a>
					</div>
				</form>
			</div>
	    </div>
    </div>